<%--
  Created by IntelliJ IDEA.
  User: wagger
  Date: 2019/05/22
  Time: 下午 10:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Login</title>
    <link rel="stylesheet" href="/client/css/auth.css">
    <link rel="shortcut icon" href="/client/images/tou.ico">
</head>

<body style="background: url('/client/images/user/bg.jpg')">
<div class="lowin">
    <div class="lowin-brand">
        <img src="/client/images/user/kodinger.jpg" alt="logo">
    </div>
    <div class="lowin-wrapper">
        <div class="lowin-box lowin-login">
            <div class="lowin-box-inner">
                <form id="myform" action="/user/login.do" method="post">
                    <p>用户登录</p>
                    <div><span style="color: red">${msg}</span></div>
                    <div class="lowin-group">
                        <label>用户名<a href="#" class="login-back-link">Sign in?</a></label>
                        <div><span style="color: red" id="namemsg"></span></div>
                        <input type="text" autocomplete="email" name="username" class="lowin-input" id="username">
                    </div>
                    <div class="lowin-group password-group">
                        <label>密码</label>
                        <div><span style="color: red" id="passwordmsg"></span></div>
                        <input type="password" name="password" autocomplete="current-password" class="lowin-input" id="password">
                    </div>
                    <button class="lowin-btn login-btn" type="button" onclick="userLogin()">
                        登录
                    </button>

                    <div class="text-foot">
                        没有账号? <a href="/client/regist.jsp" class="register-link">注册</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<footer class="lowin-footer">
    wagger208@foxmail.com
</footer>


<script src="/client/js/auth.js"></script>
<script src="/client/js/jquery-2.1.4.min.js"></script>
<script>


    function userLogin() {
        var username = $("#username").val();
        var password = $("#password").val();
        if (username == null || username == "") {
            var usernameMsg=$("#usernamemsg").html("用户名不能为空");
            return;
        }else {
            var passwordMsg=$("#passwordmsg").html("");
        }
        if (password == null || password == "") {
            var passwordMsg=$("#passwordmsg").html("密码不能为空");
            return;
        }else {
            var passwordMsg=$("#passwordmsg").html("");
        }

        $("#myform").submit();
    }
</script>
</body>